#include <iostream>
#include <vector>

using namespace std;

// https://leetcode.cn/problems/subsets/description/?envType=problem-list-v2&envId=z8Em6vKo
// 78. 子集

class Solution
{
public:
    void recursionTry(vector<vector<int>> &ans, vector<int> &nums, int index, int size, vector<int> &curSet)
    {
        if (index == nums.size())
        {
            vector<int> temp(curSet.begin(), curSet.begin() + size);
            ans.push_back(temp);
        }
        else
        {
            // 不选
            recursionTry(ans, nums, index + 1, size, curSet);
            // 选
            curSet[size++] = nums[index];
            recursionTry(ans, nums, index + 1, size, curSet);
        }
    }
    vector<vector<int>> subsets(vector<int> &nums)
    {
        vector<vector<int>> ans;
        vector<int> curSet(nums.size());
        recursionTry(ans, nums, 0, 0, curSet);
        return ans;
    }
};

int main()
{
    return 0;
}